<template>
  <div class="body-wrap">
    <div class="head">
      游客快捷登录
    </div>
    <div class="anonymous-box">
      <el-button class="login-btn"
        :loading="loading"
        type="primary"
        @click="login"><svg-icon iconClass="quick-w"/>一键快捷登录</el-button>
    </div>
    <div class="other-login">
      <p class="other-login-title">
        <b></b>
        <span>选择其他登录方式</span>
        <b></b>
      </p>
      <span class="icon-btn" title="手机号登录">
        <svg-icon iconClass="phone2"
          @click="ohterLogin('phoneLogin')" />
      </span>
      <span class="icon-btn" title="微信登录">
        <svg-icon iconClass="wechat"
          class="wechat"
          @click="ohterLogin('wxLogin')" />
      </span>
    </div>
  </div>
</template>

<script type="text/javascript">
import { mapGetters } from 'vuex'
import mixins from './mixins'
export default {
  name: 'AnonymousLogin',
  mixins: [mixins],
  props: {
    isPage: Boolean
  },
  data () {
    return {
      loading: false
    }
  },
  computed: {
    ...mapGetters(['appInfo'])
  },
  created () {
  },
  beforeDestroy () {
    clearTimeout(this.timer)
  },
  methods: {
    login () {
      this.$xzAsy('xz_anonymous_login').then(res => {
        this.$store.dispatch('user/setACDialogType', '')
      })
    },
    /**
     * 切换登录方式
     */
    ohterLogin (type) {
      this.$xz('xz_substat_action', 1724)
      this.$store.dispatch('user/login', { type })
    }
  }
}
</script>

<style lang="scss" scoped>
@import "@/styles/other-login.scss";
.body-wrap {
  width: 270px;
}
.head {
  padding: 72px 0 35px;
  font-size: 18px;
  font-weight: 400;
  text-align: center;
  color: #fff;
}
.anonymous-box{
  padding: 0 15px 81px;
  .el-button{
    position: relative;
    width: 100%;
    padding: 16px 20px;
    font-weight: bold;
    font-size: 16px;
    .svg-icon{
      position: absolute;
      left: 20px;
      top: 14px;
      font-size: 20px;
    }
  }
}
</style>
